#!/usr/bin/env python

import model

import serial

class Alinco(serial.Serial):
    
    def flare(self, device):
        self.write('BTEXT :%02d**\r' % device)
        if not self.readline(): return False
        
        self.write('B EVERY 10\r')
        line = self.readline()
        if not line: return False
        
        self.write('B EVERY 0\r')
        self.readline()
        
        return model.Measurement.parse(line)
